/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "dynamicproperty")
@NamedQueries({
    @NamedQuery(name = "Dynamicproperty.findAll", query = "SELECT d FROM Dynamicproperty d"),
    @NamedQuery(name = "Dynamicproperty.findByIddynamicproperty", query = "SELECT d FROM Dynamicproperty d WHERE d.iddynamicproperty = :iddynamicproperty"),
    @NamedQuery(name = "Dynamicproperty.findByDynamicproperty", query = "SELECT d FROM Dynamicproperty d WHERE d.dynamicproperty = :dynamicproperty")})
public class Dynamicproperty implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "iddynamicproperty")
    private Integer iddynamicproperty;
    @Basic(optional = false)
    @Column(name = "dynamicproperty")
    private String dynamicproperty;
    @JoinTable(name = "recordleveldynamicproperty", joinColumns = {
        @JoinColumn(name = "iddynamicproperty", referencedColumnName = "iddynamicproperty")}, inverseJoinColumns = {
        @JoinColumn(name = "idrecordlevelelement", referencedColumnName = "idrecordlevelelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Dynamicproperty() {
    }

    public Dynamicproperty(Integer iddynamicproperty) {
        this.iddynamicproperty = iddynamicproperty;
    }

    public Dynamicproperty(Integer iddynamicproperty, String dynamicproperty) {
        this.iddynamicproperty = iddynamicproperty;
        this.dynamicproperty = dynamicproperty;
    }

    public Integer getIddynamicproperty() {
        return iddynamicproperty;
    }

    public void setIddynamicproperty(Integer iddynamicproperty) {
        this.iddynamicproperty = iddynamicproperty;
    }

    public String getDynamicproperty() {
        return dynamicproperty;
    }

    public void setDynamicproperty(String dynamicproperty) {
        this.dynamicproperty = dynamicproperty;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddynamicproperty != null ? iddynamicproperty.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Dynamicproperty)) {
            return false;
        }
        Dynamicproperty other = (Dynamicproperty) object;
        if ((this.iddynamicproperty == null && other.iddynamicproperty != null) || (this.iddynamicproperty != null && !this.iddynamicproperty.equals(other.iddynamicproperty))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Dynamicproperty[iddynamicproperty=" + iddynamicproperty + "]";
    }

}
